package com.zhuoan.biz.bank.impl;

import com.github.miemiedev.mybatis.paginator.domain.PageList;
import com.zhuoan.biz.bank.BankBiz;
import com.zhuoan.mapper.BankMapper;
import com.zhuoan.model.Bank;
import com.zhuoan.model.condition.BankCondition;
import com.zhuoan.model.vo.BankVO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * BankBizImpl
 *
 * @author weixiang.wu
 * @date 2018-06-11 14:35
 **/
@Service
public class BankBizImpl implements BankBiz {

    private final static Logger logger = LoggerFactory.getLogger(BankBizImpl.class);

    @Resource
    private BankMapper bankMapper;


    @Override
    @Transactional(rollbackFor = Exception.class)
    public int insertSelective(Bank record) {
        return bankMapper.insertSelective(record);
    }

    @Override
    public Bank selectByPrimaryKey(Long id) {
        return bankMapper.selectByPrimaryKey(id);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public int updateByPrimaryKeySelective(Bank record) {
        return bankMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public PageList<BankVO> queryAllUsersByCondition(BankCondition bankCondition) {
        return bankMapper.queryAllUsersByCondition(bankCondition,bankCondition.getPageBounds());
    }
}
